package com.lyb.springbootredisclient.InterCepter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author: lyb  2022/10/11 21:58
 */
@Configuration
public class InterCeppterConfig implements WebMvcConfigurer {

    @Resource
    private LybInterceppter interceppter;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(interceppter).addPathPatterns("/test/redis/**");
        WebMvcConfigurer.super.addInterceptors(registry);
    }
}
